package com.nnnu.wsnackshop.service;

import com.nnnu.wsnackshop.pojo.dto.AddAddressDTO;
import com.nnnu.wsnackshop.pojo.dto.AddressPageDTO;
import com.nnnu.wsnackshop.pojo.dto.UpdateAddressDTO;
import com.nnnu.wsnackshop.pojo.entity.Addresses;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nnnu.wsnackshop.pojo.vo.AddressVO;
import com.nnnu.wsnackshop.result.PageResult;

import java.util.List;

/**
 * <p>
 * 地址表 服务类
 * </p>
 *
 * @author zk
 * @since 2025-05-14
 */
public interface IAddressesService extends IService<Addresses> {

    PageResult<AddressVO> pageAddresses(AddressPageDTO dto);

    AddressVO getAddressDetail(Long id);

    List<AddressVO> listByUser(Long userId);

    void createAddress(AddAddressDTO dto);

    void updateAddress(UpdateAddressDTO dto);

    void deleteAddresses(List<Long> ids);

    /**
     * 设置用户默认地址
     * 
     * @param userId    用户ID
     * @param addressId 地址ID
     */
    void setDefaultAddress(Integer userId, Long addressId);
}
